<?php
/**
 *
 * 下载次数统计
 *
 * 如果想显示下载次数,即把下面ＪＳ调用放到文档模板适当位置
 * <script src="{yeshili:global name='cfg_phpurl'/}/disdls.php?aid={yeshili:ye name='id'/}" language="javascript"></script> 
 * @yeshili        作者:叶世立  email:ye-shi-li@qq.com
 * @version        $Id: disdls.php 1 20:43 2013年7月8日Z xiaoye $ 
 * @package        yeshiliCMS.Site
 * @copyright      Copyright (c) 2013 - 2020, yeshiliCMS, Inc.
 */
require_once(dirname(__FILE__)."/../include/common.inc.php");
$aid = (isset($aid) && is_numeric($aid)) ? $aid : 0;
$row = $dsql->GetOne("SELECT SUM(downloads) AS totals FROM `#@__downloads` WHERE id='$aid' ");
if(empty($row['totals'])) $row['totals'] = 0;
echo "document.write('{$row['totals']}');";
exit();